import openpyxl
import DB

wb = openpyxl.load_workbook('test.xlsx')
sheet = wb['Sheet1']
data = [
    (1,'1111','admin','admin','123','11111111111','11111111111@qq.com',18,'男','北京','2020-01-01',1234567.00,'医生','北京银行'),
    (2,'2222','user','user','123','22222222222','22222222222@qq.com',18,'女','上海','2020-01-01',1234567.00,'医生','上海银行'),
    (3,'3333','user1','user1','123','33333333333','33333333333@qq.com',18,'男','广州','2020-01-01',1234567.00,'医生','广州银行'),
    (4,'4444','user2','user2','123','44444444444','44444444444@qq.com',18,'女','深圳','2020-01-01',1234567.00,'医生','深圳银行'),
    (5,'5555','user3','user3','123','55555555555','55555555555@qq.com',18,'男','杭州','2020-01-01',1234567.00,'医生','杭州银行')
        ]
for i in data:
    sql = "insert into user_info values {}".format(i)
    DB.update(sql)
wb.save('test.xlsx')
for i in sheet.iter_rows():
    for j in i:
        print(j.value,end='\t')
    print()
print(wb.encoding)
print(wb.sheetnames)
# print(wb.properties)
# print(sheet.title)
# print(sheet.dimensions)
# print(sheet.min_row)
# print(sheet.max_row)
# print(sheet.min_column)
# print(sheet.max_column)
# print(sheet.cell(row=1,column=1).value)


